package com.example.design_pattern.singleton;

/**
 * 饿汉式
 * @author: _先森
 */

public class Singleton {
    private Singleton() {
    }
    private static Singleton instance =new Singleton();

    public static Singleton getInstance(){
        return instance;
    }

    public void dosomething(){
        System.out.println("调用成功");
    }

}

